import { defineStore } from 'pinia'

interface InfoState {
  isUpload: boolean
  uploadVisible: boolean
  currentFile: File | null
}

export const useApp = defineStore('app', {
  state: (): InfoState => ({
    isUpload: true,
    uploadVisible: false,
    currentFile: null
  }),
  actions: {
    setUpload(upload: boolean) {
      this.isUpload = upload
    },
    setUploadVisible(visible: boolean) {
      this.uploadVisible = visible
    },
    setCurrentFile(file: File | null) {
      this.currentFile = file
    }
  }
})
